#include<iostream>
#include<sstream>
using namespace std;

bool isHw(string str) {
    int l=0, r=str.length()-1;
    while(l<=r) {
        if (str[l] != str[r])
            return false;
        l++;r--;
    }
    return true;
}

int main() {
    int A, B;
    cin >> A >> B;
    for (int i = A; i <= B; i++) {
        ostringstream oo;
        oo << i;
        string str = oo.str();
        if (isHw(str))
            cout << str << endl;
    }
    return 0;
}